#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int sum = 0;
	scanf("%d", &sum);
	int a = sum / 100;
	int b = sum / 10-a*10;
	int c = sum % 10;
	printf("%d", (c * 100 + b * 10 + a));
	return 0;
}